 <template>
  <div>
    <Swp :swip="arrnew"></Swp>
    <Da :data="title" v-on:send="sendEventToParent" ></Da>
  </div>
</template>
 <script>
import Swp from "./Swp.vue";
import Da from "./data.vue";
export default {
  components: {
    Swp,
    Da,
  },
  data() {
    return {
      name: "About",
      arr: [],
      arrnew: [],
      title: [],
      xq: [],
      index: "",
      id: "",
      user:{},
      other:""
    };
  },
  methods: {
    fz(str) {
      return "http://jd.itying.com/" + str.split("\\").join("/");
    },
    sendEventToParent(msd){
    this.oser=msd
    },
  
  },
  mounted() {
    this.axios
      .get("https://jd.itying.com/api/focus")
      .then((res) => {
        this.arr = res.data.result;
        this.arrnew = this.arr.splice(0, 4);
      })
      .then((res) => {
        new Swiper(".swiper-container", {
          loop: true,
          // 如果需要分页器
          pagination: ".swiper-pagination",
          autoplay: 3000,
          speed: 300, //速度的意思
        });
      });
    this.axios.get("https://jd.itying.com/api/pcate").then((res) => {
      this.title = res.data.result;
    });
  },
  computed: {},
};
</script>


<style lang='css'>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
a {
  text-decoration: none;
}
ul,
li {
  list-style: none;
}

a,
input,
button {
  -webkit-tap-highlight-color: transparent;
  /* 移除点击产生的高亮效果：透明色 */
}
input,
button {
  -webkit-appearance: none;
  /* 在ios中加入这句能修改button和input的宽高 */
}
img,
a {
  -webkit-touch-callout: none;
  /* 禁止长按弹出菜单 */
}
img {
  vertical-align: middle;
}
html,
body,
.app {
  width: 100%;
  height: 100%;
}
.lbt {
  width: 100%;
  height: 15rem;
}
.swiper-container {
  width: 100%;
  height: 100%;
}

.swiper-slide {
  text-align: center;
  font-size: 18px;
  background: #fff;

  /* Center slide text vertically  */
  display: -webkit-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  -webkit-align-items: center;
  align-items: center;
}

.Swiper {
  display: flex;
  height: 10rem;
}

.swiper-slide img {
  width: 100%;
  height: 100%;
}

.nav {
  height: 6rem;
  border: 1px solid #000;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-content: center;
}

.nav li {
  width: 4rem;
  height: 3rem;
  text-align: center;
  display: flex;
  text-align: center;
  justify-content: space-between;
  align-items: center;
}

.xr {
  width: 100%;
  height: 5rem;
  border: 1px solid #000;
  display: flex;
  justify-content: center;
}

.xr li {
  height: 3rem;
  text-align: center;
  display: flex;
  text-align: center;
  justify-content: space-between;
  align-items: center;
}

.xr img {
  width: 5rem;
  height: 5rem;
}

.xq {
  width: 100%;
  height: 5rem;
  border: 1px solid #000;
  margin-top: 5rem;
}
.im {
  width: 100%;
  height: 10rem;
  display: flex;
  justify-content: space-between;
}
.im img {
  width: 100%;
  height: 8rem;
}
</style>